const useListeningFolderRename = (initInfo, FolderRenameRef) => {
  // 显示文件夹重命名弹窗
  const showFolderRenameDialog = item => {
    FolderRenameRef.value.showDialog(item)
  }

  // 显示文件夹重命名弹窗 （树结构节点右键点击）
  const folderRenameRightClick = () => {
    initInfo.value.isContextmenuClick = true
    showFolderRenameDialog(initInfo.value.rightClickFolder)
  }

  // 显示文件重命名弹窗 （选中后，全选按钮后的操作菜单点击）
  const folderRenameMenuClick = () => {
    initInfo.value.sourceList.forEach(item => {
      if (item.isFolder && item.active) {
        showFolderRenameDialog(item)
      }
    })
  }

  // 文件夹重命名弹窗关闭后，初始化部分参数
  const folderRenameDialogClose = () => {
    initInfo.value.isContextmenuClick = false
    initInfo.value.rightClickFolder = null
  }

  return {
    showFolderRenameDialog,
    folderRenameRightClick,
    folderRenameMenuClick,
    folderRenameDialogClose
  }
}
export default useListeningFolderRename
